package cc.lucien;

import java.io.Serializable;

public class Student extends Person implements Serializable,Comparable<Student> {

    private String name;
    private int age;
    static String className;
    public static String hobby;

    public Student(){
        System.out.println("Student");
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    private void init() {
        name = "admin";
        age = 22;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public static String getClassName() {
        return className;
    }

    public static void setClassName(String className) {
        Student.className = className;
    }

    public static String getHobby() {
        return hobby;
    }

    public static void setHobby(String hobby) {
        Student.hobby = hobby;
    }

    @Override
    public int compareTo(Student o) {
        return this.age - o.age;
    }

    private static void say(){
        System.out.println("say hello");
    }

    static void write(){
        System.out.println("write");
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
